<!--简单实现-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>simple</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="app">
    <div>
      <input v-model="inputValue">
      <button @click="handleSubmit">提交</button>
    </div>
    <ul>
      <li v-for="todo,index in todos">
        {{ todo }}
      </li>
    </ul>
  </div>

  <script>
    new Vue({
      el: '#app',
      name: 'app',
      data: {
        inputValue: '',
        todos: ['起床', '吃饭', 'lol']
      },
      methods: {
        handleSubmit: function (){
          this.todos.push(this.inputValue)
          this.inputValue = ''
        }
      }
    })
  </script>

<!-- data是个函数 https://www.cnblogs.com/wangjiachen666/p/9876266.html-->
</body>
</html>